package com.hnevc.caoliuye;

public class Homework {
    public static void main(String[] args) {
        int x[] = {1,9,3,7,4,2,5,0,6,8};
        int b = 0;
        for (int i = 0; i < x.length; i++){
            for (int j = i+1; j<x.length; j++)
                if (x[i] > x[j]){ //对比大小判断数字位置
                    b = x[i];
                    x[i] = x[j];
                    x[j] = b;
                }

        }
        System.out.print("x[]=" + "{");
        for (int i = 0; i < x.length; i++){// 冒泡趟数
            System.out.print(x[i] + " " );//输出b的冒泡排序
        }
        System.out.print("}");
    }
}
